# Gua框架 - 基于Linus设计哲学的极简Web框架
from .core import GuaApp, Config, Request
from .response import Response, JSON, HTML, Text, StreamResponse, SSEResponse, Stream, SSE, sse_event, sse_ping, sse_error, sse_update
from .middleware import middleware, cors_middleware, logging_middleware, streaming_middleware, auto_stream, sse_middleware
from .websocket import ws_manager
from .sender import reply, send_error, json, html, ws_text, ws_json
from .streaming import StreamSender, SSEManager, sse_manager
from .file_handler import StreamFileHandler, file_handler
from .exceptions import (
    GuaException, GuaStreamError, GuaConnectionError
)

# 新的极简API - 消除样板代码
from .content import ContentProcessor, respond, text, error
from .builders import StreamBuilder, SSEBuilder, stream, sse, stream_range, stream_items, stream_text, sse_ping_stream
from .connection import ConnectionManager, ConnectionType, create_websocket_manager, create_sse_manager
from .middleware_builder import Middleware, cors, auth, logging, rate_limit

# 日志系统 - 基于Linus设计哲学的极简日志实现
from .logger import Event, GuaLogger, SimpleMonitor, get_default_logger, set_default_logger
from .logging_middleware import LoggingMiddleware, logging_middleware as new_logging_middleware

__version__ = "0.1.0"

__all__ = [
    # 核心组件
    "GuaApp",
    "Config",
    "Request",
    
    # 响应组件（保持向后兼容）
    "Response",
    "JSON",
    "HTML",
    "Text",
    "StreamResponse",
    "SSEResponse",
    "Stream",
    "SSE",
    "sse_event",
    "sse_ping",
    "sse_error",
    "sse_update",
    
    # 发送器组件
    "reply",
    "send_error",
    "json",
    "html",
    "ws_text",
    "ws_json",
    
    # 中间件组件（保持向后兼容）
    "middleware",
    "cors_middleware",
    "logging_middleware",
    "streaming_middleware",
    "auto_stream",
    "sse_middleware",
    
    # 连接管理组件
    "ws_manager",
    "StreamSender",
    "SSEManager",
    "sse_manager",
    
    # 文件处理组件
    "StreamFileHandler",
    "file_handler",
    
    # 异常组件
    "GuaException",
    "GuaStreamError",
    "GuaConnectionError",
    
    # 新的极简API - 统一内容处理
    "ContentProcessor",
    "respond",
    "text",
    "error",
    
    # 新的极简API - 流式构建器
    "StreamBuilder",
    "SSEBuilder",
    "stream",
    "sse",
    "stream_range",
    "stream_items",
    "stream_text",
    "sse_ping",  # 从response.py导入
    "sse_ping_stream",  # 从builders.py导入
    
    # 新的极简API - 统一连接管理
    "ConnectionManager",
    "ConnectionType",
    "create_websocket_manager",
    "create_sse_manager",
    
    # 新的极简API - 声明式中间件
    "Middleware",
    "cors",
    "auth",
    "logging",
    "rate_limit",
    
    # 日志系统 - 基于Linus设计哲学的极简日志实现
    "Event",
    "GuaLogger",
    "SimpleMonitor",
    "get_default_logger",
    "set_default_logger",
    "LoggingMiddleware",
    "new_logging_middleware",
]
